export function getData(url) {
    let result = fetch(url).then((res) => res.json());
    return result;
}

export function postData(url, data) {
    let result = fetch(url, {
        method: "post",
        data: JSON.stringify(data),
        headers: {
            "content-type": "application/json",
        },
    }).then((res) => res.json());
    return result;
}